package com.zhou.mymvpdemo.impcontract;

import com.zhou.mymvpdemo.interfaces.TaskDataSource;
import com.zhou.mymvpdemo.Utils.CheckUtils;
import com.zhou.mymvpdemo.contract.ContractViewAndPresenter;

/**
 * Created by Administrator on 2017/8/2.
 */

public class DetailPrensenter implements ContractViewAndPresenter.Presenter {

    private final ContractViewAndPresenter.View  mTaskView;
    private final SourceDataImp sourceDataImp;
    /*构造中初始化资源类  view类  并将view绑定给presneter*/

    public DetailPrensenter(ContractViewAndPresenter.View taskView) {
        //检查taskview不能为空
     mTaskView= CheckUtils.checkNotNull(taskView);


        //给view绑定presenter
        mTaskView.setPresenter(this);
        //加载资源
        sourceDataImp = SourceDataImp.getInstance();
         //调用presenter的然方法
       start();
    }

    @Override
    public void start() {
        runabc();


        //


    }

    @Override
    /*在presenter接口方法中将数据添加*/
    public void runabc() {
        sourceDataImp.addRemoteData(new TaskDataSource.Callback() {
            @Override
            public void onSuccess() {
                
            }

            @Override
            public void onFail() {

            }
        });

    }
}
